//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.gltools;

import java.awt.Color;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

public class RendererTools extends DefaultListCellRenderer {
    private static final long serialVersionUID = 1L;
    private Color rowcolor;
    private int row;
    private int[] rows;

    public RendererTools(int row, Color color) {
        this.rowcolor = color;
        this.row = row;
    }

    public RendererTools(int[] rows, Color color) {
        this.rowcolor = color;
        this.rows = rows;
    }

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        if (this.rows == null) {
            if (index == this.row) {
                this.setBackground(this.rowcolor);
            }
        } else {
            for(int i = 0; i < this.rows.length; ++i) {
                if (index == this.rows[i]) {
                    this.setBackground(this.rowcolor);
                }
            }
        }

        return this;
    }
}
